#! /usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Created by jianbing on 2017-09-08
"""

from report import SimpleReport
from report.lib import charts

report = SimpleReport()

report.set_title("V4.0版本测试报告")
report.set_summary("""
这个是说明~
需求不明确的系统太多了之类之类的。
严重度高的怎么样怎么样
严重度中等的bug有什么的什么的
""")

chart1 = charts.BarChart(title="当前每个系统的bug数量", subtitle="这个是副标题")
chart1.add_x_axis(["注册系统", "充值系统", "下载系统", "好友系统", "活动系统"])
chart1.add_series("bug数量", [13, 66, 35, 31, 9])
chart1.set_show_legend(False)

chart2 = charts.BarChart(title="每人修复bug数量")
chart2.add_x_axis(["小明", "小红", "小白", "小岚", "小绿"])
chart2.add_series("严重", [16, 55, 31, 7, 11])
chart2.add_series("中级", [1, 2, 3, 4, 5])
chart2.add_series("低级", [6, 3, 8, 5, 2])
chart2.set_show_legend(False)

chart3 = charts.LineChart(title="每天新增bug数量")
chart3.add_x_axis(["周一", "周二", "周三", "周四", "周五"])
chart3.add_series("bug数量", [33, 25, 17, 40, 55])
chart3.add_series("哈哈哈数量", [30, 99, 25, 17, 40])

chart4 = charts.PieChart(title="每天新增bug数量")
chart4.add_series(['直接访问', '邮件营销', '联盟广告'], series_data=[335, 310, 234])
chart4.set_show_legend(False)

report.add_chart(chart1)
report.add_chart(chart2)
report.add_chart(chart3)
report.add_chart(chart4)

report.save()
